INCLUDE_DIRECTORIES(
	${OSSC_BINARY_DIR}
	${OSSC_SOURCE_DIR}/
	${OSSC_SOURCE_DIR}/src
	${OSSC_SOURCE_DIR}/include/
	${OSSC_SOURCE_DIR}/include/ossc/
	)
AUX_SOURCE_DIRECTORY(util UTILS)
AUX_SOURCE_DIRECTORY(modules MODULES)
AUX_SOURCE_DIRECTORY(lib LIBS)
AUX_SOURCE_DIRECTORY(core CORE)
AUX_SOURCE_DIRECTORY(extra EXTRA)

SET(CORE_SRC
	${UTILS}
	${MODULES}
	${LIBS}
	${CORE})

ADD_LIBRARY(osscore_static STATIC ${CORE_SRC})
ADD_LIBRARY(osscore_shared SHARED ${CORE_SRC})
SET_TARGET_PROPERTIES(osscore_static PROPERTIES OUTPUT_NAME "osscore") 
SET_TARGET_PROPERTIES(osscore_shared PROPERTIES OUTPUT_NAME "osscore") 
SET_TARGET_PROPERTIES(osscore_shared PROPERTIES VERSION 0.1.6 SOVERSION 1) 

INSTALL(TARGETS
	osscore_static 
	osscore_shared
	LIBRARY DESTINATION lib
	ARCHIVE DESTINATION lib) 

INSTALL(DIRECTORY ${OSSC_SOURCE_DIR}/include/ DESTINATION include)
INSTALL(DIRECTORY ${OSSC_SOURCE_DIR}/doc/ DESTINATION share/doc/ossc/)
INSTALL(FILES ${OSSC_BINARY_DIR}/config.h DESTINATION include/ossc/)
INSTALL(FILES ${OSSC_SOURCE_DIR}/AUTHORS DESTINATION share/doc/ossc/)
INSTALL(FILES ${OSSC_SOURCE_DIR}/LGPL-2.1 DESTINATION share/doc/ossc/)
INSTALL(FILES ${OSSC_SOURCE_DIR}/LICENSE.txt DESTINATION share/doc/ossc/)

IF(UNIX)

SET(EXTRA_SRC
	${EXTRA})

ADD_LIBRARY(ossextra_shared SHARED ${EXTRA_SRC})
ADD_LIBRARY(ossextra_static STATIC ${EXTRA_SRC})
TARGET_LINK_LIBRARIES(ossextra_shared osscore_shared pthread)
TARGET_LINK_LIBRARIES(ossextra_static osscore_static pthread)
SET_TARGET_PROPERTIES(ossextra_static PROPERTIES OUTPUT_NAME "ossextra") 
SET_TARGET_PROPERTIES(ossextra_shared PROPERTIES OUTPUT_NAME "ossextra") 
SET_TARGET_PROPERTIES(ossextra_shared PROPERTIES VERSION 0.1.6 SOVERSION 1) 

INSTALL(TARGETS
	ossextra_static
	ossextra_shared
	LIBRARY DESTINATION lib
	ARCHIVE DESTINATION lib) 

ENDIF(UNIX)


